package spring.vs;

import java.util.ArrayList;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import spring.model.Person;

@Controller
public class Ch72Application {

	@RequestMapping(value="/ch72",method=RequestMethod.GET)
	public String index(Model model){
		Person single=new Person("aa",11);
		List<Person> people=new ArrayList<Person>();
		Person p1=new Person("xx",11);
		Person p2=new Person("yy",22);
		Person p3=new Person("zz",33);
		people.add(p1);
		people.add(p2);
		people.add(p3);
		model.addAttribute("singlePerson", single);
		model.addAttribute("people", people);
		return "ch72index";
	}
}
